snort3: depend on libtirpc only for musl builds
authorJohn Audia <[email protected]>
Sun, 5 Oct 2025 11:34:07 +0000 (07:34 -0400)
committerJosef Schlehofer <[email protected]>
Fri, 10 Oct 2025 06:40:59 +0000 (08:40 +0200)
The libtirpc package is only needed when building with musl, as glibc
includes the required RPC functionality. This change makes libtirpc a
conditional dependency and adjusts the build flags accordingly.

Building with x86_64-glibc:
...
Feature options:
    DAQ Modules:    Dynamic
    libatomic:      User-specified
    Hyperscan:      ON
    ICONV:          ON
    Libunwind:      OFF
    LZMA:           ON
    RPC DB:         Built-in
    SafeC:          OFF
    TCMalloc:       ON
    JEMalloc:       OFF
    UUID:           ON
    NUMA:           OFF
    LibML:          OFF
...

Building with aarch64_cortex-a76_musl:
...
Feature options:
    DAQ Modules:    Dynamic
    libatomic:      User-specified
    Hyperscan:      ON
    ICONV:          ON
    Libunwind:      OFF
    LZMA:           ON
    RPC DB:         TIRPC
    SafeC:          OFF
    TCMalloc:       ON
    JEMalloc:       OFF
    UUID:           ON
    NUMA:           OFF
    LibML:          OFF
...

Build system: x86/64
Build-tested: x86/64-glibc, bcm27flogic/xiaomi_redmi-router-ax6000-ubootmod (for musl)
Run-tested: x86/64-glibc

Signed-off-by: John Audia <[email protected]>
(cherry picked from commit e4bdefe1c298b0dc3508d788a9a42eb2346f819e)

net/snort3/Makefile

index f221bf6cb8504bea5f8fb27930072484a0a880a6..2590818bdda5cccbb2f4f0bdd00c752e1ecf25e3 100644 (file)
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=snort3
 PKG_VERSION:=3.9.5.0
-PKG_RELEASE:=4
+PKG_RELEASE:=5
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/snort3/snort3/tar.gz/$(PKG_VERSION)?
@@ -26,7 +26,7 @@ define Package/snort3
   SECTION:=net
   CATEGORY:=Network
   DEPENDS:=+libstdcpp +libdaq3 +libdnet +libopenssl +libpcap +libpcre2 \
-    +libpthread +libuuid +zlib +libhwloc +libtirpc @HAS_LUAJIT_ARCH +luajit +libatomic \
+    +libpthread +libuuid +zlib +libhwloc +USE_MUSL:libtirpc @HAS_LUAJIT_ARCH +luajit +libatomic \
     +kmod-nft-queue +liblzma +ucode +ucode-mod-fs +ucode-mod-uci \
     +PACKAGE_gperftools-runtime:gperftools-runtime \
     +PACKAGE_hyperscan-runtime:hyperscan-runtime
@@ -44,7 +44,7 @@ define Package/snort3/description
 endef
 
 CMAKE_OPTIONS += \
-       -DUSE_TIRPC:BOOL=YES \
+       -DUSE_TIRPC=$(if $(CONFIG_USE_MUSL),ON,OFF) \
        -DENABLE_STATIC_DAQ:BOOL=NO \
        -DDAQ_INCLUDE_DIR=$(STAGING_DIR)/usr/include/daq3 \
        -DDAQ_LIBRARIES_DIR_HINT:PATH=$(STAGING_DIR)/usr/lib/daq3 \
@@ -61,8 +61,7 @@ CMAKE_OPTIONS += \
        -DENABLE_HYPERSCAN=$(if $(CONFIG_PACKAGE_vectorscan-runtime),ON,OFF) \
        $(if $(CONFIG_PACKAGE_vectorscan-runtime),-DHS_INCLUDE_DIRS=$(STAGING_DIR)/usr/include/hs)
 
-TARGET_CFLAGS  += -I$(STAGING_DIR)/usr/include/daq3 -I$(STAGING_DIR)/usr/include/tirpc
-TARGET_LDFLAGS += -L$(STAGING_DIR)/usr/lib/daq3 -ltirpc
+TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include/daq3
 
 define Package/snort3/conffiles
 /etc/config/snort